package kr.saeildamil.androidstudy.ch13;

import kr.saeildamil.androidstudy.R;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ProgressBar;

public class ProgressBarTest extends Activity {
	ProgressBar mProgBar;
	ProgressBar mProgCircle;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.ch13_progressbartest);
	    mProgBar = (ProgressBar) findViewById(R.id.ch13_progressBartest_progress);
		mProgCircle = (ProgressBar) findViewById(R.id.ch13_progressbartest_circle);
	
	}

	public void mOnClick(View v) {
		switch (v.getId()) {
		case R.id.ch13_progressbartest_decfirst_btn:
			mProgBar.incrementProgressBy(-2);
			break;
		case R.id.ch13_progressbartest_incfirst_btn:
			mProgBar.incrementProgressBy(2);
			break;
		case R.id.ch13_progressbartest_decsecond_btn:
			mProgBar.incrementProgressBy(-2);
			break;
		case R.id.ch13_progressbartest_incsecond_btn:
			mProgBar.incrementProgressBy(2);
			break;
		case R.id.ch13_progressbartest_start_btn:
			mProgCircle.setVisibility(View.VISIBLE);
			break;
		case R.id.ch13_progressbartest_stop_btn:
			mProgCircle.setVisibility(View.INVISIBLE);
			break;

		}

	}
}
